<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
  <title>操作记录</title>
  <style type="text/css">
    body{
      margin: 0px;
      padding: 0px;
    }
    table{
      width: 100%;
      height: 400px;
      border: #000 1px solid;
    }
    tr td{
      height: 40px;
      text-align: center;
      border: #000 1px solid;
    }

  </style>
</head>
<body>
<div style="width:100px; height: 30px; margin: 10px auto;line-height: 30px;">
  <strong><font style="font-size:36px;">操作记录</font></strong>
</div>
<table>
  <tr>
    <td width="70px">username</td>
    <td width="90px">password</td>
    <td width="120px">gender</td>
    <td width="200px">desc</td>
  </tr>
  <!--循环遍历所有得到的记录并输出-->
  <c:forEach items="${recordList}" var="record">
    <tr>
      <td width="70px">${record.username}</td>
      <td width="90px">${record.password}</td>
      <td width="120px">${record.userId}</td>
      <td width="200px">${record.description}</td>
    </tr>
  </c:forEach>
  <tr>
    <td colspan="6">
      <!-- 分页功能 start -->
      <div align="center">
        <font size="2">共 ${page.totalPageCount} 页</font> <font size="2">第
        ${page.pageNow} 页</font> <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=1">首页</a>
        <c:choose>
          <c:when test="${page.pageNow - 1 > 0}">
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow - 1}">上一页</a>
          </c:when>
          <c:when test="${page.pageNow - 1 <= 0}">
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=1">上一页</a>
          </c:when>
        </c:choose>
        <c:choose>
          <c:when test="${page.totalPageCount==0}">
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow}">下一页</a>
          </c:when>
          <c:when test="${page.pageNow + 1 < page.totalPageCount}">
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow + 1}">下一页</a>
          </c:when>
          <c:when test="${page.pageNow + 1 >= page.totalPageCount}">
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.totalPageCount}">下一页</a>
          </c:when>
        </c:choose>
        <c:choose>
          <c:when test="${page.totalPageCount==0}">
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow}">尾页</a>
          </c:when>
          <c:otherwise>
            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.totalPageCount}">尾页</a>
          </c:otherwise>
        </c:choose>
      </div>
      <!-- 分页功能 End -->
    </td>
  </tr>
</table>
</body>
</html>